//操作定义 显示/隐藏 show 控制 
//用法：$search.showList("show",true);
//初始化传入
;
(function(window, $, undefined) {
	var $panel = $('<div class="droplist"></div>');
	$.fn.extend({
		droplist: function(key, value) {
			debugger;
			var defaultConfig = {
				height: 300,
				show: false,
				list: [1,23,3]
			}
			var settings = {};
			if(typeof key === 'object' && typeof value === 'undefined') {
				$.extend(settings, defaultConfig, key);
			}
			if(typeof key === 'string') {
				settings[key] = value;
			}
			
			var posObj = this[0].getBoundingClientRect();
			$panel.css({
				width: parseInt(this.css('width')) + 'px',
				height: settings.height + 'px',
				display: settings.show ? 'inline-block' : 'none',
				left: posObj.left + 'px',
				top: (posObj.top + this.css('height')) + 'px',
			});
			$('body').append($panel);
			//			$(window).resize(function() {
			//
			//			})
		}
	})
})(window, jQuery);